﻿#ifndef CONNECT_C2S_H
#include "Connect.h"

#ifdef __cplusplus
extern "C" {
#endif

	uint32_t Connect_C2S_CreateHandle();

	int Connect_C2S_TcpConnect(uint8_t* connectPayload, uint32_t handle, const char* host, uint16_t port);
	int Connect_C2S_TcpDisconnect(uint8_t* connectPayload, uint32_t handle);
	int Connect_C2S_TcpSend(uint8_t* connectPayload, uint32_t handle, const uint8_t* data, uint16_t size);
	int Connect_C2S_TcpList(uint8_t* connectPayload, uint32_t handle);
	int Connect_C2S_SavedataList(uint8_t* connectPayload, uint32_t handle);
	int Connect_C2S_SavedataSave(uint8_t* connectPayload, uint32_t handle, const char* name, const uint8_t* data, uint16_t size);
	int Connect_C2S_SavedataLoad(uint8_t* connectPayload, uint32_t handle, const char* name, uint8_t* data, uint16_t maxSize);
	int Connect_C2S_SavedataDelete(uint8_t* connectPayload, uint32_t handle, const char* name);
	int Connect_C2S_NodeRegist(uint8_t* connectPayload, uint32_t handle, const char* nodeName);
	int Connect_C2S_NodeUnregist(uint8_t* connectPayload, uint32_t handle, const char* nodeName);
	int Connect_C2S_NodePublish(uint8_t* connectPayload, uint32_t handle, const char* nodeName, const uint8_t* data, uint16_t size);
	int Connect_C2S_NodeSubscribe(uint8_t* connectPayload, uint32_t handle, const char* nodeName);
	int Connect_C2S_OtaRecived(uint8_t* connectPayload, uint32_t handle, const uint8_t* data, uint16_t size);
	int Connect_C2S_OtaFinshed(uint8_t* connectPayload, uint32_t handle);


#ifdef __cplusplus
}
#endif

#endif // CONNECT_C2S_H